package model;

public class Disciplina {

	private Long codigoDisc;
	private String nomeDisc;
	private int creditos;

	public Disciplina(){
		super();
	}

	public Disciplina(String nomeDisc, long cod){
		this();
		this.nomeDisc = nomeDisc;
		this.codigoDisc = cod;
	}

	public Disciplina(String nomeDisc, long cod, int cred){
		this(nomeDisc, cod);
		this.creditos = cred;
	}
	
	public Long getCodigoDisc() {
		return codigoDisc;
	}

	public void setCodigoDisc(Long codigoDisc) {
		this.codigoDisc = codigoDisc;
	}

	public String getNomeDisc() {
		return nomeDisc;
	}

	public void setNomeDisc(String nomeDisc) {
		this.nomeDisc = nomeDisc;
	}

	public int getCreditos() {
		return creditos;
	}

	public void setCreditos(int creditos) {
		this.creditos = creditos;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + codigoDisc.longValue());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Disciplina other = (Disciplina) obj;
		if (codigoDisc != other.codigoDisc)
			return false;
		return true;
	}	
}
